package com.example.neo4j.dao;

import com.example.neo4j.bean.Person;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
import org.springframework.data.neo4j.repository.query.Query;

import java.util.List;

@EnableNeo4jRepositories
public interface Neo4jPersonRepository extends Neo4jRepository<Person,Long> {

    @Query("match (n:loveperson)-[:`初恋`]->(p:loveperson) where n.name = $name return p")
    List<Person> findByName(String name);

}
